﻿
var userArea = {
	editFormSetting : function(){
		var btnSetting = {
		        "취소": function() {
		          $( this ).dialog( "close" );
		        }
			};
		common.dialogPopup($("#dialog-userEditForm"), btnSetting);
	},
	editMyInfo: function(user_id){
		$.post(contextPath+"/member/info.json", { "user_id" : user_id }, function(data) {

		}, "json").done(function(data) {
			var userInfo = data.userInfo;
			if(userInfo){
				var $dialogAdminMaster = $("#dialog-userEditForm");

				$dialogAdminMaster
					.find("[name=adminId]").val(userInfo.adminId).prop("readonly", true).end()
					.find("[name=adminNm]").val(userInfo.adminNm).end()
					.find("[name=codeDept]").val(userInfo.codeDept).end()
					;

				var btnSetting = {
					"수정": function() {
						userArea.dataEdit("수정", userArea.dataUpdate);
			        },
			        "취소": function() {
			        	$( this ).dialog( "close" );
			        }
				};
				$dialogAdminMaster.dialog({ buttons: btnSetting }).dialog( "open" );

			}else{
				common.alert("서버에 이상이 있습니다!");
			}
		}).fail(function(data) {
			common.alert("서버에 이상이 있습니다!");
			return false;
		});
	}
};

$(function(){
	userArea.editFormSetting();
	$("#logout").click(userArea.logout);
});